﻿<Window x:Class="Hockey.UILayer.Forms.Licenses"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation" 
        loc:Translate.Uid="FRM_LicTitle"               
        xmlns:service="clr-namespace:MVVMDialogs;assembly=MVVMDialog"              
        service:DialogService.IsRegisteredView="True"            
        Title="{loc:Translate Default='Seznam externích knihoven'}" Height="480" Width="640" MinHeight="300"  MinWidth="500"
        Background="{DynamicResource WindowBackgroundBrush}" ShowInTaskbar="False" ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="36" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="26" />
                <RowDefinition Height="26" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock FontWeight="Bold" Grid.Row="0" Grid.Column="0" Margin="3" 
                       loc:Translate.Uid="FRM_LicProgramName" Text="{loc:Translate Default='Jméno aplikace:'}" TextAlignment="Center" ></TextBlock>
            <TextBlock FontWeight="Bold" Grid.Row="1" Grid.Column="0" Margin="3"
                       loc:Translate.Uid="FRM_LicURL" Text="{loc:Translate Default='URL aplikace:'}" TextAlignment="Center" ></TextBlock>
            <TextBlock x:Name="uxProgramName" Grid.Row="0" Grid.Column="1" Margin="3" Text="{Binding Path=ProgramName}"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Margin="3" >
                <Hyperlink x:Name="uxLink" RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="{Binding Path=URLNavigation}">
                    <TextBlock x:Name="uxURL" Text="{Binding Path=URLTitle}" />
                </Hyperlink>
            </TextBlock>                      
        </Grid>
        <GroupBox loc:Translate.Uid="FRM_LicGroupBox" Header="{loc:Translate Default='Externí knihovny'}" Grid.Row="1" Margin="3">
            <DataGrid x:Name="uxLibraries" Margin="3" HeadersVisibility="None" ItemsSource="{Binding Path=Libraries}" AutoGenerateColumns="False"
                      CanUserAddRows="False" CanUserDeleteRows="False" >                              
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="*">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LibraryName}" />
                                    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Author}"/>
                                    <TextBlock Grid.Row="1" Grid.ColumnSpan="2">
                                        <Hyperlink NavigateUri="{Binding Path=URL}" RequestNavigate="Hyperlink_RequestNavigate">
                                            <TextBlock Text="{Binding Path=URL}" />
                                        </Hyperlink>
                                    </TextBlock>                                    
                                </Grid>                                         
                            </DataTemplate>                            
                        </DataGridTemplateColumn.CellTemplate>                        
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
                <DataGrid.CellStyle>
                    <Style TargetType="DataGridCell">
                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Background" Value="White" />
                                <Setter Property="Foreground" Value="Black" />
                            </Trigger>
                        </Style.Triggers>                        
                    </Style>
                </DataGrid.CellStyle>
            </DataGrid>            
        </GroupBox>
        <Button loc:Translate.Uid="FRM_LicClose" Content="{loc:Translate Default='Zavřít'}" x:Name="btnClose" Grid.Row="2" Width="100" HorizontalAlignment="Right" Margin="6"></Button>
    </Grid>
</Window>
